<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->


    <link href="__ADMIN_TMPL__/public/assets/themes/{:cmf_get_admin_style()}/bootstrap.min.css" rel="stylesheet">
    <link href="__ADMIN_TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__ADMIN_TMPL__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '{$Request.module}'/*当前应用名*/
        };
    </script>
    <script src="__ADMIN_TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__ADMIN_TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container:'body',
                html:true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <if condition="APP_DEBUG">
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    </if>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:cmf_plugin_url('QbtVote://AdminIndex/index')}">投票列表</a></li>
        <li><a href="{:cmf_plugin_url('QbtVote://AdminIndex/add')}">添加</a></li>
    </ul>
    <form action="" method="post" class="js-ajax-form margin-top-20">
<div class="table-actions">
            
            
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:cmf_plugin_url('QbtVote://AdminIndex/ajaxstate',['state'=>0])}" data-subcheck="true">开启
            </button>
            
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:cmf_plugin_url('QbtVote://AdminIndex/ajaxstate',['state'=>1])}" data-subcheck="true">关闭
            </button>

            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:cmf_plugin_url('QbtVote://AdminIndex/del')}" data-subcheck="true">删除
            </button>
            <span class="ts" style="display: none;color: #f00;margin-left: 10px;">至少选择一项</span>
        </div>
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
            <th width="16">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
            <th>ID</th>
                <th>标题</th>
                <th>选择类型</th>
                <th>单次投票数</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>状态</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                	<td>
                        <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo['id']}">
                    </td>
                	<td>{$vo['id']}</td>
                    <td>{$vo['name']}</td>
                    <td><if condition="$vo['everytime'] elt 1">单选<else />多选</if></td>
                    <td>{$vo['everytime']}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['start_time'])}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['end_time'])}</td>
                    <td class="a{$vo['id']}"><if condition="$vo['state']==1">关闭<else/>启用</if></td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td>
                    	<a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:cmf_plugin_url('QbtVote://AdminIndex/item',array('vote_id'=>$vo['id']))}','管理 {$vo.name} 页面',{});">管理页面</a>
                       <a href="{:cmf_plugin_url('QbtVote://AdminIndex/vote',['id'=>$vo['id']])}">查看</a>
                        <a href="{:cmf_plugin_url('QbtVote://AdminIndex/edit',['id'=>$vo['id']])}">编辑</a>
                        <a href="{:cmf_plugin_url('QbtVote://AdminIndex/del1',['id'=>$vo['id']])}" class="js-ajax-delete">删除</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/noty/noty-2.4.1.js"></script>
</body>
</html>